package com.example.myapplication;

import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class ArticleDetailActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_article_detail);

        TextView tvTitle = findViewById(R.id.tv_detail_title);
        TextView tvAuthor = findViewById(R.id.tv_author);
        TextView tvTime = findViewById(R.id.tv_time);
        TextView tvContent = findViewById(R.id.tv_detail_content);

        // 接收传递的数据
        String title = getIntent().getStringExtra("title");
        String author = getIntent().getStringExtra("author");
        String time = getIntent().getStringExtra("time");
        String content = getIntent().getStringExtra("content");

        // 设置显示内容
        tvTitle.setText(title);
        tvAuthor.setText("作者：" + author);
        tvTime.setText("发布时间：" + time);
        tvContent.setText(content);
    }
}